<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <p>{{ msg }}</p>
        <p>{{ age }}</p>
        <p>{{ age + 20 }}</p>
        <p>{{ age >= 18 ? '成年' : '未成年' }}</p>

        <!-- 插值语法里不可以写语句，否则会报错 -->
        <!-- <p>{{ if(age>=18) {'成年'} else {'未成年'}  }}</p> -->
    </div>
    <script src="./vue.js"></script>
    <script>
        // 实例化一个vue对象
        new Vue ({
            el: '#app',
            data: {
                msg: '你好',
                age: 14
            }
        })
    </script>
</body>
</html>